package wechat.custapp;

import org.eclipse.xtext.xbase.lib.InputOutput;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.junit.Ignore;
import org.junit.Test;
import wechat.base.snd.WCButton;
import wechat.base.snd.WCMenu;
import wechat.custapp.WCCorpCustApplication;
import wechat.custapp.WXCorpCustAppFactory;

@SuppressWarnings("all")
public class CreateCustomerMenuTest {
  @Test
  @Ignore
  public void deletemenu() {
    WCCorpCustApplication _defaultCorpApp = WXCorpCustAppFactory.getDefaultCorpApp();
    final Procedure1<WCCorpCustApplication> _function = new Procedure1<WCCorpCustApplication>() {
      public void apply(final WCCorpCustApplication it) {
        it.deleteMenu();
      }
    };
    ObjectExtensions.<WCCorpCustApplication>operator_doubleArrow(_defaultCorpApp, _function);
  }
  
  @Test
  @Ignore
  public void createMenu() {
    final WCCorpCustApplication app = WXCorpCustAppFactory.getDefaultCorpApp();
    WCMenu _wCMenu = new WCMenu();
    final Procedure1<WCMenu> _function = new Procedure1<WCMenu>() {
      public void apply(final WCMenu it) {
        WCButton _createBtn = it.createBtn();
        final Procedure1<WCButton> _function = new Procedure1<WCButton>() {
          public void apply(final WCButton it) {
            it.setName("评价项目");
            it.setType("click");
            it.setKey("CUSTOMER_APPRAISAL");
          }
        };
        WCButton _doubleArrow = ObjectExtensions.<WCButton>operator_doubleArrow(_createBtn, _function);
        it.withButton(_doubleArrow);
      }
    };
    final WCMenu m = ObjectExtensions.<WCMenu>operator_doubleArrow(_wCMenu, _function);
    InputOutput.<String>println(m.build().toString());
    String _createMenu = app.createMenu(m);
    String _plus = ("******************************" + _createMenu);
    InputOutput.<String>println(_plus);
  }
}
